package cn.zhj.base.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

class MyPagerAdapter:FragmentPagerAdapter {
    private var mFragments:ArrayList<Fragment>
    private var titles:ArrayList<String>

    constructor(fm :FragmentManager , fragments:ArrayList<Fragment> , titles:ArrayList<String>):super(fm){
        this.mFragments = fragments
        this.titles = titles
    }

    override fun getItem(position: Int): Fragment {
        return mFragments[position]
    }

    override fun getCount(): Int {
        return mFragments.size
    }

    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position]
    }

}